package com.klun.concTrueWar.RMI.Server;

import com.klun.concTrueWar.RMI.Client.Warehouse;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.HashMap;
import java.util.Map;

public class WarehouseImpl extends UnicastRemoteObject implements Warehouse{

    private Map<String,Double> prices;

    protected WarehouseImpl() throws RemoteException {
        prices = new HashMap<>();
        prices.put("whm",29.00);
        prices.put("mc",30.00);
    }

    @Override
    public double getPrice(String description) throws RemoteException {
        Double price = prices.get(description);
        return price;
    }
}
